package ClassesFieldsMethods;

public class CarDemo {

	public static void main(String[] args) 
	{
		Car car1 = new Car();
		Car car2 = new Car();
		car1.toString();
		
		car1.model = "Fiat";
		car1.maxSpeed = 180;
		car1.currentSpeed = 80;
		car1.color = "red";
		car1.currentGear = 3;
		System.out.println("Current speed of car 1 is: " + car1.currentSpeed);
		System.out.println("Current gear of car 1 is: " + car1.currentGear);
		car1.owner = new Person();
		car1.owner.name = "Maria";
		car1.owner.age = 25;
		System.out.println("The owner of the first car is " + car1.owner.name);
		System.out.println("The age of the first owner is " + car1.owner.age);
		
		//Po grafichnata chast shte uchim: Spring - komponenti, JSP, Servlets
		//Nakraia shte praivm site kato proekt
		
		
		car1.currentGear = 2;
		car1.currentSpeed = 20;
		System.out.println("Now the current speed of the car 1 is: " + car1.currentSpeed);
		System.out.println("Now the current gear of the car 1 is: " + car1.currentGear);
		
		car1.accelerate();
		car1.changeGearUp();
		
		
		car2.model = "Ford";
		car2.maxSpeed = 200;
		car2.currentSpeed = 100;
		car2.color = "Black";
		car2.currentGear = 3;
		car2.owner2 = new Person();
		car2.owner.name = "Ivan";
		car2.owner.age = 22;
		System.out.println("The owner of the second car is " + car2.owner.name);
		System.out.println("The age of the second owner is " + car2.owner.age);

	}

}
